#include <iostream>
#include <future>
#include <random>
#include <thread>
int process(char ch)
{
	std::default_random_engine dre(ch);
	std::uniform_int_distribution<int> id(10,1000);
	for (int i=0;i<100;i++)
	{
		std::this_thread::sleep_for(std::chrono::milliseconds(id(dre)));
		std::cout<<ch;
	}
	return ch;
}

int main()
{
	std::future<int> result1( std::async(process,'.'));
	std::future<int> result2( std::async(process,'*'));
	std::future<int> result3( std::async(process,'-'));

	int re = process('+');

	int result = result1.get() + result2.get() + result3.get() + re;

	std::cout<<result<<std::endl;

	return 0;
}